﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="InputVerificationPage.aspx.cs" Inherits="FBKPI.Pages.InputVerificationPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {

            $("#btn_back").click(function () {
                document.location = "../Pages/VerificatePage.aspx"; //?User=" + $("#txt_user").val();
                return false;
            });

            var totalKpiChild = $("#<%=hfTotalDataKpiChild.ClientID %>").val();
            var KpiId = $("#<%=hfKpiId.ClientID %>").val();
            if (totalKpiChild != "0") {
                var handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>' + "?method=GetByKPIChild&KpiId=" + KpiId;
                var html = "";
                var html2 = "";
                var counter = 1;
                $("#tblKpiChild").append("<tr><td style='width:30px;' align='center'><b>No</b></td><td align='center' style='width:500px;'><b>KPI</b></td><td align='center' style='width:200px;'><b>Periode</b></td><td align='center' style='width:200px;'><b>Attachment</b></td></tr>");
                $.ajax({
                    type: 'POST',
                    url: handlerUrl,
                    contentType: 'application/json',
                    dataType: 'json',
                    success: function (datas) {
                        $.each(datas, function (i, data) {

                            //$("#tblKpiChild").append("<tr><td>" + counter + ".</td><td>" + data.Description + "</td><td>Test</td>");
                            html = "<tr><td align='center'>" + counter + ".</td><td style='padding-left:10px;'>" + data.Description + "</td><td style='padding-left:10px;'>" + data.Periode + "</td>";
                            //alert(data.ID);
                            var handlerUrlAttachment = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>' + "?method=GetKPIAttachmentByKpiId&KpiId=" + data.ID;
                            var handlerUrlDownload = '<%= ResolveUrl("~/ProcessRequest/Downloadhandler.ashx") %>';
                            $.ajax({
                                type: 'POST',
                                url: handlerUrlAttachment,
                                contentType: 'application/json',
                                dataType: 'json',
                                success: function (datasAttachment) {
                                    $.each(datasAttachment, function (a, dataAttachment) {
                                        // html2 += "<li>" + "<a href='" + handlerUrlDownload + "?KPIAttachmentID=" + dataAttachment.ID + "'>" + dataAttachment.DocumentFileName + "</a>" + "</li>";
                                        html2 += "<tr><td><li>" + "<a href='" + handlerUrlDownload + "?KPIAttachmentID=" + dataAttachment.ID + "'>" + dataAttachment.DocumentFileName + "</a>" + "</li></tr></td>";
                                    });


                                    $("#tbl" + data.ID).append(html2);
                                    //$("#tblKpiChild").append(html + "<td><ul type='square'>" + html2 + "</ul></td></tr>");
                                },
                                error: function () {
                                    alert('Error load data kpi child attachemnt !');
                                }

                            });

                            //$("#tblKpiChild").append(html + "<td><ul type='square'>" + html2 + "</ul></td></tr>");

                            $("#tblKpiChild").append(html + "<td><table id='tbl" + data.ID + "'></table></td></tr>");

                            counter++;
                        });
                    },
                    error: function () {
                        alert('Error load data kpi child !');
                    }
                });

            }

        });
    </script>

    <script language="javascript" type="text/javascript">

        $(function () {
            $("#tabs").tabs();
        });

    </script>

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {

            var totalAttachment = $("#<%=hfTotalDataAttachment.ClientID %>").val();
            var KPIAssignID = $("#<%=hfKpiAssignId.ClientID %>").val();
            //var KpiId = $("#<%=hfKpiId.ClientID %>").val();
            //var KPIAssignDetailID = $("#<%=hfKpiAssignDetailId.ClientID %>").val();
            var html = "";
            var counter = 1;
            var handlerUrlDownload = '<%= ResolveUrl("~/ProcessRequest/Downloadhandler.ashx") %>';

            if (totalAttachment != "0") {
                var handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>' + "?method=GetByKPIAttachmentVerificator&KPIAssignID=" + KPIAssignID;
                $("#tblAttachment").append("<tr><td colspan='2'><b>Attachment : </b></td></tr>");
                $.ajax({
                    type: 'POST',
                    url: handlerUrl,
                    contentType: 'application/json',
                    dataType: 'json',
                    success: function (datas) {
                        $.each(datas, function (i, data) {
                            $("#tblAttachment").append("<tr><td>" + counter + ".&nbsp;&nbsp;</td><td>" + "<a href='" + handlerUrlDownload + "?KPIAttachmentID=" + data.ID + "'>" + data.DocumentFileName + "</a></td></tr>");
                            //html += "<tr><td>" + counter + ".&nbsp;&nbsp;</td><td>" + "<a href='" + handlerUrlDownload + "?KPIAttachmentID=" + data.ID + "'>" + data.DocumentFileName + "</a></td></tr>";
                            counter++;
                        });
                    },
                    error: function () {
                        alert('Error load data attachment !');
                    }
                });
               
            }

        });
    </script>

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#<%=btn_save.ClientID%>").click(function () {
                var MethodDtlId = "";
                var Realization = "";
                var Score = "";
                var isLock = "";
                var isOneSelectionYearly = false;
                var isOneSelectionYearlyValue = 0;
                var isOneSelectionSemester1 = false;
                var isOneSelectionSemester2 = false;
                $('#tableMethod tr').each(function () {

                    var row = $(this);
                    var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                    if (idCheckBox == "yearly" || idCheckBox == "semester1" || idCheckBox == "semester2"
                        || idCheckBox == "Q1" || idCheckBox == "Q2" || idCheckBox == "Q3" || idCheckBox == "Q4" || idCheckBox == "weekly") {
                        isLock += "undefined|";
                        //idCheckBox = "";

                    }

                    if (idCheckBox == "yearly") {
                        if (row.find('input[type="checkbox"]').is(':checked')) {
                            isOneSelectionYearly = true;
                        }

                    }

                    if (idCheckBox == "semester1") {
                        if (row.find('input[type="checkbox"]').is(':checked')) {
                            isOneSelectionSemester1 = true;
                        }
                    }

                    if (idCheckBox == "semester2") {
                        if (row.find('input[type="checkbox"]').is(':checked')) {
                            isOneSelectionSemester2 = true;
                        }
                    }

                    if (idCheckBox != "yearly" && idCheckBox != "semester1" && idCheckBox != "semester2"
                        && idCheckBox != "Q1" && idCheckBox != "Q2" && idCheckBox != "Q3" && idCheckBox != "Q4" && idCheckBox != "weekly") {
                        if (row.find('input[type="checkbox"]').is(':checked')) {
                            isLock += "1|";
                        }
                        else {
                            isLock += "0|";
                        }
                    }

                    var idTextBox = row.find('input[type="text"]').attr('id');
                    var idHidden = row.find('input[type="hidden"]').attr('id');
                    if (idTextBox != "" && idTextBox != "undefined") {
                        MethodDtlId += idHidden + "|";

                        var value = row.find('input[type="text"]').val();
                        //alert(value);
                        var valueScore = $('[name=txtScore' + idCheckBox + ']').val();
                        var valueRealisasi = $('[name=txtRealisasi' + idCheckBox + ']').val();
                        //alert(datalevel);
                        Realization += valueRealisasi + "|";
                        Score += valueScore + "|";

                    }

                    //var idFile = row.find('input[type="file"]').attr('id');
                    //alert(idFile);
                });

                //                if (isOneSelectionYearly) {

                //                    var mySplitResult = Realization.split("|");
                //                    for (i = 1; i < mySplitResult.length - 1; i++) {

                //                        if (mySplitResult[i] != "")
                //                            isOneSelectionYearlyValue += 1;
                //                    }

                //                    if (isOneSelectionYearlyValue > 1) {
                //                        $.msgBox("Isi nilai tidak boleh lebih dari satu !", null, { title: "Pesan" });
                //                    }

                //                }

                //                if (isOneSelectionSemester1) {

                //                    var mySplitResult = Realization.split("|");
                //                    for (i = 1; i < mySplitResult.length - 1; i++) {

                //                        if (mySplitResult[i] == "undefined")
                //                            break;
                //                        if (mySplitResult[i] != "")
                //                            isOneSelectionYearlyValue += 1;
                //                    }

                //                    if (isOneSelectionYearlyValue > 1) {
                //                        $.msgBox("Semester 1 isi nilai tidak boleh lebih dari satu !", null, { title: "Pesan" });
                //                    }
                //                }

                //                if (isOneSelectionSemester2) {
                //                    isOneSelectionYearlyValue = 0;
                //                    var valueSemester2 = "";
                //                    var mySplitResult = Realization.split("|");
                //                    for (i = 1; i < mySplitResult.length - 1; i++) {

                //                        if (mySplitResult[i] == "undefined")
                //                            valueSemester2 = mySplitResult[i];

                //                        if (valueSemester2 == "undefined") {
                //                            alert(mySplitResult[i]);
                //                            if (mySplitResult[i] != "" && mySplitResult[i] == "undefined") {
                //                                isOneSelectionYearlyValue += 1;
                //                            }
                //                            alert(isOneSelectionYearlyValue);
                //                        }

                //                    }
                //                    alert(isOneSelectionYearlyValue);
                //                    if (isOneSelectionYearlyValue > 1) {
                //                        $.msgBox("Semester 2 isi nilai tidak boleh lebih dari satu !", null, { title: "Pesan" });
                //                    }
                //                }

                //alert(Score);
                //alert(isLock);
                //alert(Realization);

                var KPIAssignID = $("#<%=hfKpiAssignId.ClientID %>").val();
                var Year = $("#<%=txt_kpiyear.ClientID %>").val();
                var Status = $("#<%=ddl_statusbyverificator.ClientID %> option:selected").val();
                if (Status == "0") {
                    $.msgBox("Pilih status KPI by verificator !", null, { title: "Pesan Error" });
                    return false;
                }
                var param = "?";
                param = param + "&MethodDtlId=" + MethodDtlId;
                param = param + "&Realization=" + Realization;
                param = param + "&KPIAssignID=" + KPIAssignID;
                param = param + "&Year=" + Year;
                param = param + "&isLock=" + isLock;
                param = param + "&Score=" + Score;
                param = param + "&Status=" + Status;
                param = param + "&CurrUser=" + $("#txt_user").val();

                $.ajax({ url: '../ProcessRequest/' + "KPIAchievementVerificatorHandler.ashx" + param, type: "POST",
                    success: function (response) {
                        //alert(response);
                        $.msgBox(response, null, { title: "Pesan" });
                        if (response.indexOf('Success') > 0) {

                            document.location = "../Pages/VerificatePage.aspx";
                        }

                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        //alert(xhr.responseText);
                        $.msgBox(xhr.responseText, null, { title: "Pesan Error" });
                    }
                });

                return false;

            });
        });
    </script>

    <script type="text/javascript">
        $(document).ready(function () {

            var KpiId = $("#<%=hfKpiId.ClientID %>").val();
            $("#tableMethod tr").remove();
            var html = "";
            var handlerUrl = "";
            //        if(KpiId!="")
            //        {
            handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>' + "?method=GetByKPIAchievment&KpiId=" + KpiId;
            var totalData = $("#<%=hfTotalDataAchievment.ClientID %>").val();
            if (totalData != "0") {
                var KPIAssignID = $("#<%=hfKpiAssignId.ClientID %>").val();
                handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>' + "?method=GetByKPIAchievmentEdit&KPIAssignID=" + KPIAssignID;
            }


            var isYearly = false;
            var htmlYearly = "";
            var htmlSemester1 = "";
            var htmlSemester2 = "";
            var htmlQ1 = "";
            var htmlQ2 = "";
            var htmlQ3 = "";
            var htmlQ4 = "";
            var methodId = "";
            var Realization = "";
            var Score = "";
            $.ajax({
                type: 'POST',
                url: handlerUrl,
                contentType: 'application/json',
                dataType: 'json',
                success: function (datas) {
                    $.each(datas, function (i, data) {
                        methodId = data.MethodDetail.MethodID;
                        if (data.MethodDetail.MethodID == 1) {

                            if (isYearly == false) {
                                if (data.isOneSelection == true) {
                                    htmlYearly = "<tr><td><input disabled='disabled' checked='checked' type='checkbox' id='yearly' />Only One Selection</td><td style='padding-left:30px;'>Realisasi</td><td style='padding-left:30px;'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                }
                                else {
                                    htmlYearly = "<tr><td><input disabled='disabled'  type='checkbox' id='yearly' />Only One Selection</td><td style='padding-left:30px;'>Realisasi</td><td style='padding-left:30px;'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                }

                                isYearly = true;
                            }

                            if (totalData != "0") {

                                Realization = data.Realization;

                                if (data.Score != "0")
                                    Score = data.Score;
                                else
                                    Score = "";
                            }


                            if (data.isLocked)
                                htmlYearly += "<tr><td><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input size='30' type='text' disabled='disabled' value='" + Realization + "' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:30px;'><input size='10' type='text'  value='" + Score + "' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "'  name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            else
                                htmlYearly += "<tr><td><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input size='30' type='text' disabled='disabled' value='" + Realization + "' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:30px;'><input size='10' type='text' value='" + Score + "' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";

                        }



                        if (data.MethodDetail.MethodID == 2) {

                            if (data.MethodDetail.MethodDtlName == "Jan" || data.MethodDetail.MethodDtlName == "Feb"
                                || data.MethodDetail.MethodDtlName == "Mar" || data.MethodDetail.MethodDtlName == "Apr"
                                || data.MethodDetail.MethodDtlName == "May" || data.MethodDetail.MethodDtlName == "Jun") {
                                if (htmlSemester1 == "") {
                                    if (data.isOneSelection == true) {
                                        htmlSemester1 = "<tr><td style='width:100px;'><input disabled='disabled' checked='checked' type='checkbox' id='semester1'/>Semester 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                    else {
                                        htmlSemester1 = "<tr><td style='width:100px;'><input disabled='disabled'  type='checkbox' id='semester1'/>Semester 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                if (data.isLocked)
                                    htmlSemester1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                    htmlSemester1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }


                            if (data.MethodDetail.MethodDtlName == "Jul" || data.MethodDetail.MethodDtlName == "Aug"
                                || data.MethodDetail.MethodDtlName == "Sep" || data.MethodDetail.MethodDtlName == "Oct"
                                || data.MethodDetail.MethodDtlName == "Nov" || data.MethodDetail.MethodDtlName == "Dec") {


                                if (htmlSemester2 == "") {
                                    if (data.isOneSelection == true) {
                                        // htmlSemester2 = "<tr><td colspan='2' style='padding-top:10px;'><input disabled='disabled' checked='checked' type='checkbox' id='semester2' />Semester 2&nbsp;&nbsp;Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlSemester2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='semester2'/>Semester 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                    else {
                                        //htmlSemester2 = "<tr><td colspan='2' style='padding-top:10px;'><input disabled='disabled'  type='checkbox' id='semester2' />Semester 2 &nbsp;&nbsp;Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlSemester2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='semester2'/>Semester 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlSemester2 += "<tr><td style='width:10px;'>" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";

                                if (data.isLocked)
                                //htmlSemester2 += "<tr><td style='width:5px;'>" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked' /></td></tr>";
                                    htmlSemester2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:30px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlSemester2 += "<tr><td style='width:5px;'>" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td></tr>";
                                    htmlSemester2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }
                        }

                        if (data.MethodDetail.MethodID == 3) {

                            if (data.MethodDetail.MethodDtlName == "Jan" || data.MethodDetail.MethodDtlName == "Feb"
                                || data.MethodDetail.MethodDtlName == "Mar") {
                                if (htmlQ1 == "") {
                                    if (data.isOneSelection == true) {
                                        htmlQ1 = "<tr><td style='width:100px;'><input disabled='disabled' checked='checked' type='checkbox' id='Q1'/>Q 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        htmlQ1 = "<tr><td style='width:100px;'><input disabled='disabled'  type='checkbox' id='Q1'/>Q 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";

                                if (data.isLocked)
                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";

                            }

                            if (data.MethodDetail.MethodDtlName == "Apr"
                                || data.MethodDetail.MethodDtlName == "May" || data.MethodDetail.MethodDtlName == "Jun") {

                                if (htmlQ2 == "") {
                                    if (data.isOneSelection == true) {
                                        //htmlQ2 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='Q2' /> Q 2&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='Q2'/>Q 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ2 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled'  type='checkbox' id='Q2' /> Q 2&nbsp;&nbsp; Only One Selection</td></tr>";
                                        htmlQ2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='Q2'/>Q 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";

                                if (data.isLocked)
                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input  type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }



                            if (data.MethodDetail.MethodDtlName == "Jul" || data.MethodDetail.MethodDtlName == "Aug"
                                || data.MethodDetail.MethodDtlName == "Sep") {

                                if (htmlQ3 == "") {
                                    if (data.isOneSelection == true) {
                                        //htmlQ3 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='Q3' />Q 3&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ3 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='Q3'/>Q 3</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ3 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled'  type='checkbox' id='Q3' />Q 3&nbsp;&nbsp; Only One Selection</td></tr>";
                                        htmlQ3 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='Q3'/>Q 3</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";
                                if (data.isLocked)
                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ3 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input  type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ3 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }

                            if (data.MethodDetail.MethodDtlName == "Oct"
                                || data.MethodDetail.MethodDtlName == "Nov" || data.MethodDetail.MethodDtlName == "Dec") {

                                if (htmlQ4 == "") {
                                    if (data.isOneSelection == true) {
                                        // htmlQ4 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='Q4' />Q 4&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ4 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='Q4'/>Q 4</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ4 = "<tr><td style='padding-top:20px;' colspan='2'><input disabled='disabled'  type='checkbox' id='Q4' /> Q 4&nbsp;&nbsp; Only One Selection</td></tr>";
                                        htmlQ4 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='Q4'/>Q 4</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }
                                //htmlQ4 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";

                                if (data.isLocked)
                                //htmlQ4 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ4 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ4 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ4 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }
                        }


                        if (data.MethodDetail.MethodID == 4) {

                            if (data.MethodDetail.MethodDtlName == "Jan" || data.MethodDetail.MethodDtlName == "Feb"
                                || data.MethodDetail.MethodDtlName == "Mar" || data.MethodDetail.MethodDtlName == "Apr") {
                                if (htmlQ1 == "") {
                                    if (data.isOneSelection == true) {
                                        //htmlQ1 = "<tr><td colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan1' /> Triwulan 1&nbsp;&nbsp;Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ1 = "<tr><td style='width:100px;'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan1'/>Triwulan 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ1 = "<tr><td colspan='2'><input disabled='disabled'  type='checkbox' id='triwulan1' />Triwulan 1&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ1 = "<tr><td style='width:100px;'><input disabled='disabled'  type='checkbox' id='triwulan1'/>Triwulan 1</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td>></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";
                                if (data.isLocked)
                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ1 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ1 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }

                            if (data.MethodDetail.MethodDtlName == "May"
                                || data.MethodDetail.MethodDtlName == "Jun" || data.MethodDetail.MethodDtlName == "Jul" || data.MethodDetail.MethodDtlName == "Aug") {

                                if (htmlQ2 == "") {
                                    if (data.isOneSelection == true) {
                                        //htmlQ2 = "<tr><td style='padding-top:10px;' colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan2' />Triwulan 2&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan2'/>Triwulan 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ2 = "<tr><td style='padding-top:10px;' colspan='2'><input disabled='disabled'  type='checkbox' id='triwulan2' />Triwulan 2&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ2 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='triwulan2'/>Triwulan 2</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";
                                if (data.isLocked)
                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ2 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ2 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }


                            if (data.MethodDetail.MethodDtlName == "Sep" || data.MethodDetail.MethodDtlName == "Oct"
                                || data.MethodDetail.MethodDtlName == "Nov" || data.MethodDetail.MethodDtlName == "Dec") {

                                if (htmlQ3 == "") {
                                    if (data.isOneSelection == true) {
                                        //htmlQ3 = "<tr><td style='padding-top:10px;' colspan='2'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan3' />Triwulan 3&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ3 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled' checked='checked' type='checkbox' id='triwulan3'/>Triwulan 3</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";

                                    }
                                    else {
                                        //htmlQ3 = "<tr><td style='padding-top:10px;' colspan='2'><input disabled='disabled'  type='checkbox' id='triwulan3' />Triwulan 3&nbsp;&nbsp; Only One Selection</td><td style='padding-left:30px;'>Lock</td></tr>";
                                        htmlQ3 = "<tr><td style='width:100px;padding-top:20px;'><input disabled='disabled'  type='checkbox' id='triwulan3'/>Triwulan 3</td><td style='padding-left:10px'>Realisasi</td><td style='padding-left:10px'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>";
                                    }
                                }

                                if (totalData != "0") {
                                    Realization = data.Realization;
                                    if (data.Score != "0")
                                        Score = data.Score;
                                    else
                                        Score = "";
                                }

                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+" '/></td></tr>";
                                if (data.isLocked)
                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input disabled='disabled' type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' disabled='disabled' checked='checked'/></td></tr>";
                                    htmlQ3 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input disabled='disabled' size='30' type='text' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input  type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                                else
                                //htmlQ3 += "<tr><td>" + data.MethodDetail.MethodDtlName + "&nbsp;&nbsp;</td><td><input type='text' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' value='"+Realization+"' /></td><td style='padding-left:30px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'/></td></tr>";
                                    htmlQ3 += "<tr><td style='width:100px;'><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:10px;'><input size='30' type='text' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' value='" + Realization + "' /></td><td style='padding-left:10px;'><input type='text' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' value='" + Score + "' size='10' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>";
                            }


                        }

                        if (data.MethodDetail.MethodID == 5) {

                            if (isYearly == false) {
                                if (data.isOneSelection == true) {
                                    htmlYearly = "<tr><td><input disabled='disabled' checked='checked' type='checkbox' id='weekly' />Only One Selection</td><td style='padding-left:30px;'>Realisasi</td><td style='padding-left:30px;'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>"; //<td style='padding-left:50px;'>Attachment</td></tr>";
                                }
                                else {
                                    htmlYearly = "<tr><td><input disabled='disabled'  type='checkbox' id='weekly' />Only One Selection</td><td style='padding-left:30px;'>Realisasi</td><td style='padding-left:30px;'>Score</td><td style='padding-left:50px;'>Status</td><td style='padding-left:50px;'>UnLock</td></tr>"; //<td style='padding-left:50px;'>Attachment</td></tr>";
                                }

                                isYearly = true;
                            }

                            if (totalData != "0") {
                                Realization = data.Realization;
                                if (data.Score != "0")
                                    Score = data.Score;
                                else
                                    Score = "";
                            }


                            if (data.isLocked)
                            //htmlYearly  += "<tr><td>" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input type='text' disabled='disabled' value='"+Realization+"' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td><td style='padding-left:50px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"'  disabled='disabled' checked='checked' /></td></tr>";
                                htmlYearly += "<tr><td><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input size='30' type='text' disabled='disabled' value='" + Realization + "' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:30px;'><input size='10' type='text'  value='" + Score + "' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:50px;'>Lock</td><td style='padding-left:50px;'><input id='" + data.MethodDetail.MethodDetailID + "' checked='checked' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>"; //<td style='padding-left:50px;'><input type='file' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td></tr>";
                            else
                            //htmlYearly  += "<tr><td>" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input size='30' type='text' value='"+Realization+"' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td><td style='padding-left:30px;'><input size='10' type='text' value='"+Realization+"' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td><td style='padding-left:50px;'><input type='checkbox' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td><td style='padding-left:50px;'><input type='file' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td></tr>";
                                htmlYearly += "<tr><td><input type='hidden' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' />" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:30px;'><input size='30' type='text' value='" + Realization + "' disabled='disabled' id='txtRealisasi" + data.MethodDetail.MethodDetailID + "' name='txtRealisasi" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:30px;'><input size='10' type='text' value='" + Score + "' id='txtScore" + data.MethodDetail.MethodDetailID + "' name='txtScore" + data.MethodDetail.MethodDetailID + "' /></td><td style='padding-left:50px;'>UnLock</td><td style='padding-left:50px;'><input type='checkbox' id='" + data.MethodDetail.MethodDetailID + "' name='" + data.MethodDetail.MethodDetailID + "' /></td></tr>"; //<td style='padding-left:50px;'><input type='file' id='"+data.MethodDetail.MethodDetailID+"' name='"+data.MethodDetail.MethodDetailID+"' /></td></tr>";
                        }

                    });

                    //alert(methodId);

                    if (methodId == "1") {
                        $("#tableMethod").append(htmlYearly);
                    }

                    if (methodId == "2") {
                        //$("#tableMethod").append("<tr><td>Semester 1</td><td><input disabled='disabled' type='checkbox' id='semester1' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlSemester1);
                        //$("#tableMethod").append("<tr><td>Semester 2</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='semester2' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlSemester2);
                    }

                    if (methodId == "3") {
                        //$("#tableMethod").append("<tr><td>Q 1</td><td><input disabled='disabled' type='checkbox' id='Q1' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ1);
                        //$("#tableMethod").append("<tr><td>Q 2</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q1' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ2);
                        //$("#tableMethod").append("<tr><td>Q 3</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q3' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ3);
                        //$("#tableMethod").append("<tr><td>Q 4</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q4' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ4);
                    }

                    if (methodId == "4") {
                        //$("#tableMethod").append("<tr><td>Q 1</td><td><input disabled='disabled' type='checkbox' id='Q1' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ1);
                        //$("#tableMethod").append("<tr><td>Q 2</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q1' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ2);
                        //$("#tableMethod").append("<tr><td>Q 3</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q3' /> Only One Selection</td></tr>");
                        $("#tableMethod").append(htmlQ3);
                        //$("#tableMethod").append("<tr><td>Q 4</td><td style='padding-top:15px;'><input disabled='disabled' type='checkbox' id='Q4' /> Only One Selection</td></tr>");

                    }

                    if (methodId == "5") {
                        $("#tableMethod").append(htmlYearly);
                    }

                },
                error: function () {
                    alert('Error load method detail !');
                }
            });


            // }
        });
    </script>
   
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="formInputaVerification" action="VerificatePage.aspx">
    <div>
        <div class="customPageTitle">
            KPI Information</div>
        <br />
        <div class="customPageContent">
            <table width="100%">
                <tr>
                    <td width="50%">
                        <table>
                            <tr>
                                <td width="140px">
                                    Description
                                </td>
                                <td class="Separator">
                                    :
                                </td>
                                <td>
                                    <asp:TextBox TextMode="MultiLine" Width="400" Rows="2" ID="txt_kpidescription" runat="server"
                                        ReadOnly="true" class="longText"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Group
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpigroup" Width="400" runat="server" ReadOnly="true" class="longText"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Category
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpicategory" runat="server" Width="400" ReadOnly="true" class="longText"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Type
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpitype" runat="server" Width="400" ReadOnly="true" class="longText"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Sub Type
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpisubtype" runat="server" Width="400" ReadOnly="true" class="longText"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Status By User
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:Label ID="lblStatusUser" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td width="140px">
                                    Status By Verificator
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddl_statusbyverificator" runat="server" Enabled="true">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            
                        </table>
                    </td>
                    <td width="50%">
                        <table>
                            
                            <tr>
                                <td width="100px" style="padding-left:50px;">
                                    Year
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpiyear" runat="server" ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="100px" style="padding-left:50px;">
                                    Periode
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_kpiperiode" runat="server" ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-left:50px;">
                                    Polarization
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_polarization" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-left:50px;">
                                    Weight
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_weight" runat="server" ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            
                            <tr>
                                <td style="padding-left:50px;">
                                    is Active
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <asp:CheckBox ID="chk_active" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Method KPI</a></li>
                <li><a href="#tabs-2">KPI Child</a></li>
            </ul>
            <div id="tabs-1">
                
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <table id="tableMethod" cellpadding="0" cellspacing="0">
                            </table>
                        </td>
                        <td style="padding-left: 50px;">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td colspan="3">
                                        <table id="tblAttachment" cellpadding="0" cellspacing="0">
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
               
               <br />
                <input type="hidden" id="KPI" runat="server" /><input type="hidden" id="KPIAssign"
                    runat="server" /><input type="hidden" id="KPIAssignDetail" runat="server" /><input
                        type="hidden" id="State" runat="server" />
                <button id="btn_save" class="ui-button ui-corner-all ui-button ui-state-default ui-button-text-icon-primary"
                    runat="server" name="btnSave">
                    <span class="ui-button-icon-primary ui-icon ui-icon-check"></span>
                    <label class="ui-button-text">
                        Save</label>
                </button>
                <button id="btn_back" class="ui-button ui-corner-all ui-button ui-state-default ui-button-text-icon-primary">
                    <span class="ui-button-icon-primary ui-icon ui-icon-arrowthick-1-w"></span>
                    <label class="ui-button-text">
                        Back</label>
                </button>
            </div>
            <div id="tabs-2">
                <table id="tblKpiChild" border="2" cellpadding="0" cellspacing="0">
                </table>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="hfKpiId" runat="server" />
    <asp:HiddenField ID="hfKpiAssignId" runat="server" />
    <asp:HiddenField ID="hfKpiAssignDetailId" runat="server" />
    <asp:HiddenField ID="hfTotalDataAchievment" Value="0" runat="server" />
    <asp:HiddenField ID="hfTotalDataAttachment" Value="0" runat="server" />
    <asp:HiddenField ID="hfTotalDataKpiChild" Value="0" runat="server" />
    </form>
</asp:Content>
